import Redirect from 'umi/redirect';
import { Authority } from 'toolkit';

const authRoute = (props: { children: any; }) => {
    // return props.children;
    //加入权限路由的判断
    if (Authority.getToken()) {
        return props.children;
    }
    else {
        let redirect = new Redirect({ "to": "/login" });
        return redirect;
    }
}

export default authRoute;